﻿<UserControl x:Class="ExORMDesginer.UserControls.CanvasDesginer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:s="clr-namespace:DiagramDesigner"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="..\CustomControls/DrawItem.xaml"/>
                <ResourceDictionary Source="..\CustomControls/Resources/ListBoxItemStyle.xaml"/>
                <ResourceDictionary Source="..\DiagramDesigner/Resources/ApplicationToolbar.xaml"/>
                <ResourceDictionary Source="..\DiagramDesigner/Resources/Connection.xaml"/>
                <ResourceDictionary Source="..\DiagramDesigner/Resources/DesignerItem.xaml"/>
                <ResourceDictionary Source="..\DiagramDesigner/Resources/gridstyle.xaml"/>
                <ResourceDictionary Source="..\DiagramDesigner/Resources/Stencils/FlowChartStencils.xaml"/>
                <ResourceDictionary Source="..\DiagramDesigner/Resources/Stencils/ShapeStencils.xaml"/>
                <ResourceDictionary Source="..\DiagramDesigner/Resources/Styles/Brushes.xaml"/>
                <ResourceDictionary Source="..\DiagramDesigner/Resources/Styles/Expander.xaml"/>
                <ResourceDictionary Source="..\DiagramDesigner/Resources/Styles/GroupBox.xaml"/>
  
                <ResourceDictionary Source="..\DiagramDesigner/Resources/Styles/Shared.xaml"/>
                <ResourceDictionary Source="..\DiagramDesigner/Resources/Styles/Slider.xaml"/>
                <ResourceDictionary Source="..\DiagramDesigner/Resources/Styles/ToolBar.xaml"/>
                <ResourceDictionary Source="..\DiagramDesigner/Resources/WindowStyel.xaml"/>
                <ResourceDictionary Source="..\DiagramDesigner/Resources/WindowStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
    	<Grid.Resources>
	   		<ContextMenu x:Key="DesignerCanvasContextMenu">
	            <MenuItem Header="粘贴" Command="{x:Static ApplicationCommands.Paste}">
	                <MenuItem.Icon>
	                    <Image Source="..\DiagramDesigner/Resources/Images/Paste.png" Width="16"/>
	                </MenuItem.Icon>
	            </MenuItem>
	            <MenuItem Header="选择所有" Command="{x:Static s:DesignerCanvas.SelectAll}"/>
        	</ContextMenu>
		</Grid.Resources>
        <telerik:RadExpander Panel.ZIndex="999" telerik:AnimationManager.IsAnimationEnabled="True" IsExpanded="False"  Header="缩略图"  Margin="0,0,11,10"  HorizontalAlignment="Right" VerticalAlignment="Bottom" >
            <s:ZoomBox Panel.ZIndex="999" Width="175" Height="150"  ScrollViewer="{Binding ElementName=DesignerScrollViewer}"/>
        </telerik:RadExpander>
        
        <ScrollViewer Name="DesignerScrollViewer"
                                                  HorizontalScrollBarVisibility="Auto"
                                                  VerticalScrollBarVisibility="Auto">
            <s:DesignerCanvas x:Name="MyDesignerCanvas"
                                          MinHeight="2500"
                                          MinWidth="2500"
                                          Focusable="true"
                                          FocusVisualStyle="{x:Null}"
                                          AllowDrop="True"
                                          ContextMenu="{StaticResource DesignerCanvasContextMenu}" Background="#FF252323"
                                          />
        </ScrollViewer>
        
    </Grid>
</UserControl>
